package com.wfh.rpc;

import com.wfh.rpc.model.User;
import com.wfh.rpc.proxy.ServiceProxyFactory;
import com.wfh.rpc.service.UserService;
import lombok.extern.slf4j.Slf4j;

/**
 * @Title: EasyComsumerExample
 * @Author wangfenghuan
 * @Package com.wfh.rpc
 * @Date 2025/10/12 11:56
 * @description: 服务消费者
 */
@Slf4j
public class EasyComsumerExample {

    public static void main(String[] args) {
        UserService userService = ServiceProxyFactory.getProxy(UserService.class);
        User user = new User();
        user.setUsername("wangfenghuan");
        // 调用
        User newUser = userService.getUser(user);
        if (newUser != null){
            log.info("newUser: {}", newUser.getUsername());
        }else {
            log.info("newUser == null");
        }
    }

}
